<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    html {
      height: 100%;
      background: url(https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2768562195,1983061365&fm=26&gp=0.jpg);
      background-size: 100% 100%;
      /* 背景图不会动，页面可以滚动 */
      background-attachment: fixed;
    }
  </style>
</head>

<body>
  <div class="box"></div>
  <h3>两种常用背景图设置</h3>
  <p>background-size:cover ===> 1.图片不会变形，2.占满屏幕,3.多出的溢出不显示</p>
  <p>background-size:contain ===> 1.图片不会变形，2.图片全显示，3.多余的空间不管(空着)</p>
  <p>
    background复合值写法顺序：background-color、background-image、background-repeat、backgound-attachment、background-position/background-size<br />
    (position和size都是数字加 / 分开)
  </p>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <footer>我是底部</footer>
</body>

</html>